package cz.muni.fi.pa165.musiclibrary.api.database.entity;

import java.io.Serializable;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * A genre of the song.
 * 
 * @author Maros Kucbel
 * @date 2012-10-07T19:21:15+0200
 */
public interface IGenre extends Serializable {

    /**
     * Returns identifier of this genre.
     * @return Identifier of this genre.
     */
    @Nonnull
    Long getIdGenre();
    
    /**
     * Returns name of this genre.
     * @return Name of this genre.
     */
    @Nonnull
    String getName();
    
    /**
     * Sets identifier of this genre.
     * @param idGenre Identifier of this genre. Cannot be {@code null}.
     */
    void setIdGenre(@Nullable final Long idGenre);
    
    /**
     * Sets name of this genre.
     * @param name Name of this genre. Cannot be {@code null}.
     */
    void setName(@Nonnull final String name);
    
    /**
     * Two genres are equal, if and only if their identifiers 
     * ({@link #getIdGenre()}) are equal.
     * 
     * @param obj The reference object with which to compare.
     * @return {@code true} if this object is the same as the obj
     *          argument; {@code false} otherwise.
     */
    @Override
    boolean equals(final Object obj);
    
    /**
     * Returns hash code value for this object based on {@link #getIdGenre()} value. 
     * @return Hash code value for this object.
     */
    @Override
    int hashCode();
}
